import { ILoadMapTypeAll } from '@/common';
import { getTenantID } from '@/utils';

const ManagePageTypeConfig = (pageUrl: string) => {
  const pageUrlStr: string = pageUrl?.split('contractController/')?.[1];
  switch (pageUrlStr) {
    case 'draftManage': //合同起草
      return {
        state: [`${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1000`],
        addBtnDom: true, //是否显示添加按钮
      };
    case 'carefulManage': //合同审核
      return {
        state: [
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1001`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1002`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1003`,
        ],
        stateSearch: true, // 是否显示状态搜索框 & 状态列
        checkStateColumns: true, //是否显示审核状态列
      };
    case 'performManage': //合同履行
      return {
        state: [
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1004`,
          // `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1005`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1006`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1007`,
        ],
        stateSearch: true,
        manageTreeTable: true, //是否以折叠表格显示
      };
    case 'archivedManage': //合同已归档
      return {
        state: [`${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1005`],
        stateSearch: true,
        manageTreeTable: true, //是否以折叠表格显示
      };
    case 'allSearchManage': //合同查询
      return {
        exportBtnDom: true,
        state: [
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1001`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1002`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1003`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1004`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1005`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1006`,
          `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1007`,
        ],
        stateSearch: true, // 是否显示状态搜索框 & 状态列
        manageTreeTable: true,
      };
    case 'oversightManage': //合同督办
      return {
        oversightBtnDom: true,
        state: `${getTenantID()}${ILoadMapTypeAll.CONTRACT_STATE}1003`,
      };
    default:
      return null;
  }
};

export { ManagePageTypeConfig };
